package com.barneyx.mshinfoplatform.entity.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import lombok.Getter;

@ApiModel("店铺状态")
@Getter
public enum EStoreState implements IEnum<String> {
    /**
     * 审核中
     */
    AUDIT(1, "AUDIT"),
    /**
     * 通过审核
     */
    PASS(2, "PASS"),
    /**
     * 未通过
     */
    NOTPASS(3, "NOTPASS"),

    /**
     * 违规
     */
    VIOLATIONS(4, "VIOLATIONS"),
    /**
     * 过期
     */
    EXPIRES(5, "EXPIRES"), //过期
    ;

    EStoreState(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public static EStoreState EStoreState(int code) {
        for (EStoreState e : EStoreState.values()) {
            if (e.code == code) {
                return e;
            }
        }
        return null;
    }

    @EnumValue
    private final int code;
    @JsonValue
    private final String value;
}
